#include <stdio.h>

int main() {
    double result = 0;
    double massTotal, massRocket, totalTime, exhaustVelocity, gravity;
    scanf("%lf%lf%lf%lf%lf", &massTotal, &massRocket, &totalTime, &exhaustVelocity, &gravity);
    double massFuel = massTotal - massRocket;
    double fuelDecrease = massFuel / totalTime;
    double thrust = fuelDecrease * exhaustVelocity;
    double currTime = 0;
    double velocity = 0;
    const double TIMESTEP = 0.1;
    while (currTime < totalTime) {
        double accelerate = thrust / massTotal - gravity;
        // 可是按道理应该是这样的，结果却是把gravity去掉才能AC？
        velocity += accelerate * TIMESTEP;
        result += velocity * TIMESTEP;
        massTotal -= fuelDecrease * TIMESTEP;
        currTime += TIMESTEP;
    }
    printf("%.3lfkm", result / 1000);
    return 0;
}